<div class="rightcolumn">
    <div class="NAVsub">
        <ul id="submenu">
            <h2>Danh mục sản phẩm</h2>
            <?php
            $cate_criteria = new CDbCriteria();
            $cate_criteria->condition = 't.active=:active AND t.parent=:parent';
            $cate_criteria->params = array(':active' => 1, ':parent' => 0);
            $cate_criteria->order = 't.order asc';
            $cate = Category::model()->findAll($cate_criteria);
            foreach ($cate as $key => $value) {
                $subcate = MyFunctionCustom::getAllCategoryByParent($value['id']);
                if (count($subcate) > 0) {
                    echo '<li><a href = "' . Yii::app()->baseUrl . '/danh-muc-san-pham/' . $value['slug'] . '.html">' . $value['name'] . '</a>';
                    echo '<ul class="sub-child">';
                    foreach ($subcate as $s => $c) {
                        echo '<li><a href = "' . Yii::app()->baseUrl . '/danh-muc-san-pham/' . $c['slug'] . '.html">' . $c['name'] . '</a></li>';
                    }
                    echo '</ul></li>';
                } else {
                    if(!isset($_GET['id']) && Yii::app()->getController()->getId() == 'product' && $key == 0){
                        echo '<li class="selected"><a href = "' . Yii::app()->baseUrl . '/danh-muc-san-pham/' . $value['slug'] . '.html">' . $value['name'] . '</a></li>';
                    }else{
                        echo '<li><a href = "' . Yii::app()->baseUrl . '/danh-muc-san-pham/' . $value['slug'] . '.html">' . $value['name'] . '</a></li>';
                    }
                }
            }
            ?>
        </ul>
    </div>
    <?php
    $project_criteria = new CDbCriteria();
    $project_criteria->condition = 't.view = :view';
    $project_criteria->params = array(':view' => 1);
    $project = Project::model()->findAll($project_criteria);
    if ($project):
        ?>
        <div class="pjtypical">
            <h2>Dự án tiêu biểu</h2>
            <div id="gallery">
                <?php foreach ($project as $key => $value): ?>
                    <a href="<?= Yii::app()->baseUrl ?>/du-an/<?= $value['slug'] ?>.html" class="show">
                        <img src="<?= Yii::app()->baseUrl ?>/timthumb.php?src=<?= Yii::app()->baseUrl ?>/data/cover/<?= $value['cover_image'] ?>&h=240$w=235" rel="<h3><?= $value['name'] ?></h3>"/>
                    </a>
                <?php endforeach; ?>
                <div class="caption"><div class="content"></div></div>
            </div>
        </div>
    <?php endif; ?>
    <div class="support">
        <h2>Hỗ trợ trực tuyến</h2>
        <img src='<?= Yii::app()->theme->baseUrl ?>/frontend/images/hotline.jpg'/>
        <a class="spyahoo" href="ymsgr:sendim?<?= Yii::app()->params['yahoo'] ?>&m=Nội dung lời nhắn">
            <img border="0" src="http://opi.yahoo.com/online?u=<?= Yii::app()->params['yahoo'] ?>&m=g&t=1"  width="64"/>
            Hỗ trợ qua yahoo
        </a>	
        <a class="spskype" href="Skype:<?= Yii::app()->params['skype'] ?>?chat"> 
            <img border="0" src="<?= Yii::app()->theme->baseUrl ?>/frontend/images/skype.jpg" title="Hỗ trợ qua skype"> 
            Hỗ trợ qua skype
        </a>
    </div>

    <div class="linkweb">
        <h2>Liên kết website</h2>
        <select name="SltWebkhoa" id="link_site" size="1">
            <option selected="selected" value="0">--- Các website liên kết --- </option>
            <?php
            $web = Website::model()->findAll();
            foreach ($web as $key => $value) {
                echo '<option value="' . $value['link'] . '">' . $value['name'] . '</option>';
            }
            ?>
        </select>
    </div>

    <div class="partner">
        <?php
        $criteria_partner = new CDbCriteria();
        $criteria_partner->limit = 8;
        $partner = Partner::model()->findAll($criteria_partner);
        foreach($partner as $p){
          echo '<a href="'.$p['link'].'">';
          echo '<img src="'.Yii::app()->baseUrl.'/timthumb.php?src='. Yii::app()->baseUrl.'/data/cover/'. $p['cover_image'].'&h=240$w=235"/>';
          echo '</a>';
        }
        ?>
        
    </div>
</div>